import { create } from '../asyncActionCreator';

export const TypeOption = {
	// 平均闯关次数
	TIMES: 0,
	// 平均闯关数
	COUNT: 1,
};

export const DEPTH_MISSION_URL = '/api/data/DepthMission';

export const GET_DATA_REQUEST = 'request depth mission chart data';
export const GET_DATA_SUCCESS = 'request depth mission chart data success';
export const GET_DATA_FAILURE = 'request depth mission chart data failure';

export const getDataRequest = () => ({
	type: GET_DATA_REQUEST,
	payload: { 
	}
});

export const getDataSuccess = (data) => ({
	type: GET_DATA_SUCCESS,
	payload: {
		...data
	}
});

export const getDataFailure = (message) => ({
	type: GET_DATA_FAILURE,
	payload: {
		message
	}
});

export const getRetainedData = (params) => (create(
	DEPTH_MISSION_URL,
	getDataRequest,
	getDataSuccess,
	getDataFailure,
	params
));